import java.util.ArrayList;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
/**
 *
 * @author user Ehab, Marcus, Ayad ooo ZOZO
 */
public class Task1 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        ArrayList<Integer> array = new ArrayList<>();
        int total = 0;
        int counter = 0;
        int max;
        int largest = 0;
        int smallest;
        int average = 0;
        int x = 0;

        System.out.println("Please enter a number and if you want to fininsh press -1: ");

        while (x == 0) {

            System.out.println("Enter a number: ");
            int number = input.nextInt();
            if (number >= 0) {
                array.add(number);
            } else if (number < 0) {
                smallest = array.get(0);
                for (int i = 0; i < array.size(); i++) {
                    counter = array.size();
                    total += array.get(i);
                    average = total / array.size();
                    largest = array.get(i);
                    x = 1;
                }
                System.out.println("Largest:" + largest);
                System.out.println("Smalest:" + smallest);
                System.out.println("Average:" + average);
                System.out.println("COUNT :" + counter);
                System.out.println("The sum of the Numbers; " + total);
            }

        }

    }
}
